package Java实验.实验二;

public class Demo2 {
    public void addition(int a, int n) {
        /********** Begin *********/
        int temp=a;
        int sum=0;
        while(n>0){
            sum+=a;
            a=a*10+temp;
            n--;
        }
        System.out.println(sum);
    }
    public static void main(String[] args) {
        Demo2 d2 = new Demo2();
        d2.addition(2,2);
        d2.addition(2,3);
        d2.addition(3,2);
    }
}
